package com.uphone.magicleafteacher.pro.adapter;

import android.graphics.Color;

import com.blankj.utilcode.util.SizeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.uphone.magicleafteacher.R;
import com.uphone.magicleafteacher.util.CommonUtil;
import com.uphone.magicleafteacher.view.MyBaseViewHolder;
import com.uphone.magicleafteacher.vo.RetellingLearnBean;

public class RetellingLearAdapter extends BaseQuickAdapter<RetellingLearnBean.ReadBookListBean, MyBaseViewHolder> {

    public RetellingLearAdapter() {
        super(R.layout.layout_item_rete);
    }


    @Override
    protected void convert(MyBaseViewHolder helper, RetellingLearnBean.ReadBookListBean item) {
        //点评状态, 1:点评中, 0:未完成, 2: 已完成
        helper.setImageViewCorner(mContext, R.id.iv_pic, CommonUtil.getImageUrl(item.getBookPic()), SizeUtils.dp2px(5))
                .setText(R.id.tv_bookname, CommonUtil.getStr(item.getBookName()))
                .setText(R.id.tv_ask, CommonUtil.getStr(item.getStudentName()))
                .setText(R.id.tv_time, CommonUtil.getStr(item.getReadDate()))
                .setText(R.id.text_follow, item.getReadStatus() == 2 ? "已点评" : "开始点评")
                .setTextColor(R.id.text_follow, item.getReadStatus() == 2 ? Color.parseColor("#666666") : Color.WHITE)
                .setBackgroundRes(R.id.text_follow, item.getReadStatus() == 2 ? R.color.transparent : R.drawable.shape_rectangle_round_bg_theme_20);

    }
}
